<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <form action="" th:action="${user==null?'add':'upd'}" method="post">
        <p>编号：<input type="text" name="id" th:value="${user?.id}" readonly></p>
        <p>姓名：<input type="text" name="name" th:value="${user?.name}"></p>
        <p>年龄：<input type="text" name="age" th:value="${user?.age}"></p>
        <p>邮箱：<input type="text" name="email" th:value="${user?.email}"></p>
        <p><input type="submit" value="提交"></p>
    </form>
</body>
</html>